<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page isErrorPage="true" %>


    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
    boolean handled = false; // Set to true after handling the error
    
    // Get the PageContext
    if(pageContext != null) {
    
        // Get the ErrorData
        ErrorData ed = null;
        try {
            ed = pageContext.getErrorData();
        } catch(NullPointerException ne) {
            // If the error page was accessed directly, a NullPointerException
            // is thrown at (PageContext.java:514).
            // Catch and ignore it... it effectively means we can't use the ErrorData
        }

        // Display error details for the user
        if(ed != null) {
    
            // Output this part in HTML just for fun
            %>
                <p />Error Data is available.
            <%
    
            // Output details about the HTTP error
            // (this should show error code 404, and the name of the missing page)
            out.println("<br />ErrorCode: " + ed.getStatusCode());
            out.println("<br />URL: " + ed.getRequestURI());
    
            // Error handled successfully, set a flag
            handled = true;
        }
    }
   


    // Check if the error was handled
    if(!handled) {
    %>
        <p />No information about this error was available.
    <%
    }
%>

    <%= exception.toString() %>

</body>
</html>